home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000919_interran@uluru.Stanford.EDU_Fri Sep 9 09:10:35 1994.msg < prev    next >
Internet Message Format  |  1994-10-11  |  6KB

  1. Received: from uluru.Stanford.EDU by cs.umb.edu with SMTP id AA23926
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Fri, 9 Sep 1994 19:10:39 -0400
  3. Received: by uluru.Stanford.EDU (4.1/inc-1.0)
  4.     id AA19186; Fri, 9 Sep 94 16:10:35 PDT
  5. Date: Fri, 9 Sep 94 16:10:35 PDT
  6. From: interran@uluru.Stanford.EDU (John Interrante)
  7. Message-Id: <9409092310.AA19186@uluru.Stanford.EDU>
  8. To: tex-k@cs.umb.edu
  9. Subject: xdvik-18a: tr ' ' '\n' is not portable
  10.  
  11. Summary: kpathsea's Makefile uses tr ' ' '\n', but SunOS's tr thinks
  12. that '\n' means 'n', not NEWLINE.
  13.  
  14. The details:
  15.  
  16. I unpacked xdvik-18a.tar.gz on a SPARCstation 1 running SunOS 4.1.2.
  17. I made NO changes whatsoever to the source.
  18. I said "./configure". 
  19. Then I said "make" (my make is really GNU Make 3.71):
  20.  
  21. cd /user/interran/xdvik-18a/
  22. make
  23. cd kpathsea; make   CFLAGS='-g ' SHELL='/bin/sh' prefix=/usr/local exec_prefix=/usr/local bindir=/usr/local/bin scriptdir=/usr/local/bin libdir=/usr/local/lib datadir=/usr/local/lib infodir=/usr/local/info includedir=/usr/local/include manext=1 mandir=/usr/local/man/man1 texmf=/usr/local/lib/texmf texinputdir=/usr/local/lib/texmf/tex mfinputdir=/usr/local/lib/texmf/mf fontdir=/usr/local/lib/texmf/fonts fmtdir=/usr/local/lib/texmf/ini basedir=/usr/local/lib/texmf/ini texpooldir=/usr/local/lib/texmf/ini mfpooldir=/usr/local/lib/texmf/ini install_fonts=true dvipsdir=/usr/local/lib/texmf/dvips psheaderdir=/usr/local/lib/texmf/dvips default_texsizes='300:600' 
  24. make[1]: Entering directory `/home/uluru/users/interran/xdvik-18a/kpathsea'
  25. echo prefix=/usr/local exec_prefix=/usr/local bindir=/usr/local/bin scriptdir=/usr/local/bin libdir=/usr/local/lib datadir=/usr/local/lib infodir=/usr/local/info includedir=/usr/local/include manext=1 mandir=/usr/local/man/man1 texmf=/usr/local/lib/texmf texinputdir=/usr/local/lib/texmf/tex mfinputdir=/usr/local/lib/texmf/mf fontdir=/usr/local/lib/texmf/fonts fmtdir=/usr/local/lib/texmf/ini basedir=/usr/local/lib/texmf/ini texpooldir=/usr/local/lib/texmf/ini mfpooldir=/usr/local/lib/texmf/ini install_fonts=true dvipsdir=/usr/local/lib/texmf/dvips psheaderdir=/usr/local/lib/texmf/dvips default_texsizes='300:600'  \
  26. | tr ' ' '\n' \
  27. | sed -e 's/^/s%@/' -e 's/=/@%/' -e 's/$/%/' -e 's/$/g/' \
  28. >texmf.sed
  29. sed -f texmf.sed -e 's%/usr/local/lib/texmf/%$TEXMF/%g' ./../kpathsea/texmf.cnf.in >texmf.cnf
  30. echo "/* paths.h: Generated from texmf.cnf `date`.  */" >../kpathsea/paths.h
  31. sed -e 's/%.*//' -e 's/^[     ]*//' -e 's/[     ]*$//' texmf.cnf \
  32. | grep '^[     ]*[A-Za-z_]*[     =]' \
  33. | sed '/^$/d' \
  34. | sed 's/^\([^     =]*\)[     ]*=*[     ]*\(.*\)/#ifndef DEFAULT_\1@#define DEFAULT_\1 "\2"@#endif/' \
  35. | tr @ '\n' \
  36. | sed 's@\$TEXMF@/usr/local/lib/texmf@g' \
  37. >>../kpathsea/paths.h
  38. gcc  -I. -I./../kpathsea -I.. -I./../kpathsea/..    -DDEFAULT_FONT_SIZES='"300:600"' \
  39.   -g  -c ./../kpathsea/tex-file.c
  40. In file included from ./../kpathsea/tex-file.c:25:
  41. ../kpathsea/paths.h:2: warning: garbage at end of `#ifndef' argument
  42. ../kpathsea/paths.h:3: warning: garbage at end of `#ifndef' argument
  43. ../kpathsea/paths.h:4: warning: garbage at end of `#ifndef' argument
  44. ../kpathsea/paths.h:5: warning: garbage at end of `#ifndef' argument
  45. ../kpathsea/paths.h:6: warning: garbage at end of `#ifndef' argument
  46. ../kpathsea/paths.h:7: warning: garbage at end of `#ifndef' argument
  47. ../kpathsea/paths.h:8: warning: garbage at end of `#ifndef' argument
  48. ../kpathsea/paths.h:9: warning: garbage at end of `#ifndef' argument
  49. ../kpathsea/paths.h:10: warning: garbage at end of `#ifndef' argument
  50. ../kpathsea/paths.h:11: warning: garbage at end of `#ifndef' argument
  51. ../kpathsea/paths.h:12: warning: garbage at end of `#ifndef' argument
  52. ../kpathsea/paths.h:13: warning: garbage at end of `#ifndef' argument
  53. ../kpathsea/paths.h:14: warning: garbage at end of `#ifndef' argument
  54. ../kpathsea/paths.h:15: warning: garbage at end of `#ifndef' argument
  55. ../kpathsea/paths.h:16: warning: garbage at end of `#ifndef' argument
  56. ../kpathsea/paths.h:17: warning: garbage at end of `#ifndef' argument
  57. ../kpathsea/paths.h:18: warning: garbage at end of `#ifndef' argument
  58. ../kpathsea/paths.h:19: warning: garbage at end of `#ifndef' argument
  59. ../kpathsea/paths.h:19: unterminated `#if' conditional
  60. make[1]: *** [tex-file.o] Error 1
  61. make[1]: Leaving directory `/home/uluru/users/interran/xdvik-18a/kpathsea'
  62. make: *** [do-kpathsea] Error 2
  63.  
  64. Compilation exited abnormally with code 2 at Fri Sep  9 15:06:55
  65.  
  66. The problem was the 
  67.  
  68. | tr ' ' '\n' \
  69.  
  70. in the pipeline that created texmf.sed.  The SunOS tr(1) man page says
  71.  
  72.      The character \, followed by 1, 2 or 3 octal digits stands for
  73.      the character whose ASCII code is given by those digits.  As with
  74.      the shell, the escape character \, followed by any other
  75.      character, escapes any special meaning for that character.
  76.  
  77. Instead of replacing each blank with a newline, tr replaced each blank
  78. with 'n'.  I have to use '\012', not '\n', if I want the replacement
  79. character to be a newline.  Two places have to be changed in
  80. kpathsea/Makefile.in: 
  81.  
  82. --- kpathsea/Makefile.in.save    Fri Sep  9 04:47:09 1994
  83. +++ kpathsea/Makefile.in    Fri Sep  9 16:03:04 1994
  84. @@ -57,5 +57,5 @@
  85.  texmf.sed: $(top_srcdir)/../make/makevars.make
  86.      echo $(makevars) \
  87. -    | tr ' ' '\n' \
  88. +    | tr ' ' '\012' \
  89.      | sed -e 's/^/s%@/' -e 's/=/@%/' -e 's/$$/%/' -e 's/$$/g/' \
  90.      >$@
  91. @@ -87,5 +87,5 @@
  92.      | sed '/^$$/d' \
  93.      | sed 's/^\([^     =]*\)[     ]*=*[     ]*\(.*\)/#ifndef DEFAULT_\1@#define DEFAULT_\1 "\2"@#endif/' \
  94. -    | tr @ '\n' \
  95. +    | tr @ '\012' \
  96.      | sed 's@\$$TEXMF@$(texmf)@g' \
  97.      >>$@
  98.  
  99. There is a second problem here too.  Notice that make overwrote
  100. kpathsea/paths.h even though it came with the distribution.  If I had
  101. made all the source files write-protected, make would have failed when
  102. it tried to overwrite paths.h.  Since paths.h is supposed to be
  103. updated whenever its dependency is changed, paths.h should not be in
  104. the distribution at all; "make" should create it from scratch and
  105. "make distclean" should remove it.
  106.  
  107.         John
  108.